package com.xayy.health.mgt.model.dto;

import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

/**
 * @author zhangxa
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DataFeatureDto {

    @ApiModelProperty(value = "批量参数代号")
    private List<String> paramCodes;

    @ApiModelProperty(value = "卫星代号")
    private String satelliteCode;

    @ApiModelProperty(value = "参数代号")
    private String paramCode;

    @ApiModelProperty(value = "类型")
    private Integer type;

    @ApiModelProperty(value = "子任务id")
    private Long taskId;

    @ApiModelProperty(value = "任务id")
    private Long parentTaskId;

    @JSONField(format = "yyyy/MM/dd HH:mm:ss")
    @ApiModelProperty(value = "开始日期")
    private Date startTime;

    @JSONField(format = "yyyy/MM/dd HH:mm:ss")
    @ApiModelProperty(value = "结束日期")
    private Date endTime;

    @ApiModelProperty(value = "1剔野值 2野值")
    private String valueType;

    @ApiModelProperty(value = "数据采样间隔")
    private Integer timeInterval;

    private String startTimeStr;

    private String endTimeStr;

    @ApiModelProperty(value = "任务名称")
    private String taskName;

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
        startTimeStr = DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss");
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
        endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss");
    }

    public String getStartTimeStr() {
        return DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss");
    }

    public String getEndTimeStr() {
        return DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss");
    }
}
